﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdCmColorBase : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdCmColorBase(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdCmColorBase obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdCmColorBase()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdCmColorBase(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public virtual OdCmEntityColor.ColorMethod colorMethod()
		{
			OdCmEntityColor.ColorMethod result = (OdCmEntityColor.ColorMethod)GlobalsPINVOKE.OdCmColorBase_colorMethod(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setColorMethod(OdCmEntityColor.ColorMethod colorMethod)
		{
			GlobalsPINVOKE.OdCmColorBase_setColorMethod(this.swigCPtr, (int)colorMethod);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool isByColor()
		{
			bool result = GlobalsPINVOKE.OdCmColorBase_isByColor(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool isByLayer()
		{
			bool result = GlobalsPINVOKE.OdCmColorBase_isByLayer(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool isByBlock()
		{
			bool result = GlobalsPINVOKE.OdCmColorBase_isByBlock(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool isByACI()
		{
			bool result = GlobalsPINVOKE.OdCmColorBase_isByACI(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool isForeground()
		{
			bool result = GlobalsPINVOKE.OdCmColorBase_isForeground(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool isByDgnIndex()
		{
			bool result = GlobalsPINVOKE.OdCmColorBase_isByDgnIndex(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual uint color()
		{
			uint result = GlobalsPINVOKE.OdCmColorBase_color(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setColor(uint color)
		{
			GlobalsPINVOKE.OdCmColorBase_setColor(this.swigCPtr, color);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setRGB(byte red, byte green, byte blue)
		{
			GlobalsPINVOKE.OdCmColorBase_setRGB(this.swigCPtr, red, green, blue);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setRed(byte red)
		{
			GlobalsPINVOKE.OdCmColorBase_setRed(this.swigCPtr, red);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setGreen(byte green)
		{
			GlobalsPINVOKE.OdCmColorBase_setGreen(this.swigCPtr, green);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void setBlue(byte blue)
		{
			GlobalsPINVOKE.OdCmColorBase_setBlue(this.swigCPtr, blue);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual byte red()
		{
			byte result = GlobalsPINVOKE.OdCmColorBase_red(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual byte green()
		{
			byte result = GlobalsPINVOKE.OdCmColorBase_green(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual byte blue()
		{
			byte result = GlobalsPINVOKE.OdCmColorBase_blue(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual ushort colorIndex()
		{
			ushort result = GlobalsPINVOKE.OdCmColorBase_colorIndex(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setColorIndex(ushort colorIndex)
		{
			GlobalsPINVOKE.OdCmColorBase_setColorIndex(this.swigCPtr, colorIndex);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool setNames(string colorName, string bookName)
		{
			bool result = GlobalsPINVOKE.OdCmColorBase_setNames__SWIG_0(this.swigCPtr, colorName, bookName);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool setNames(string colorName)
		{
			bool result = GlobalsPINVOKE.OdCmColorBase_setNames__SWIG_1(this.swigCPtr, colorName);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual string colorName()
		{
			string result = GlobalsPINVOKE.OdCmColorBase_colorName(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual string bookName()
		{
			string result = GlobalsPINVOKE.OdCmColorBase_bookName(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual string colorNameForDisplay()
		{
			string result = GlobalsPINVOKE.OdCmColorBase_colorNameForDisplay(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;
	}
}
